﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class InputFieldExManager : MonoBehaviour {
	public InputFieldEx[] m_InputFieldExID;
	private int m_InputFieldExCount;
	private int m_CurrentInputFieldExID;
	// Use this for initialization
	void Start () {
		m_InputFieldExCount = 0;
        // 找到所有找到的InputFieldEx组件
		m_InputFieldExID = Component.FindObjectsOfType<InputFieldEx> ();

        // 趋势化所有的使用此类的InputFieldEx组建
		InitInputFieldExID ();
	}

	private void InitInputFieldExID(){
        // 主要是为所有InputFieldEx分配一个ID
		if (m_InputFieldExID != null) {
			for (int i = 0; i < m_InputFieldExID.Length; i++) {

				m_InputFieldExID [i].SetInputFieldExID (m_InputFieldExCount);
				m_InputFieldExCount++;
			}
		}
	}

	public void SetCurrentInputFieldEx(int id){
		m_CurrentInputFieldExID = id;
	}

	public int GetCurrentInputFieldExID(){
		return m_CurrentInputFieldExID;
	}

	// Update is called once per frame
	void Update () {
		
	}
}
